`timescale  1 ns/1 ps

module axi4_stream_width_converter_sim ();
`include "../../common_interface_sim/axi_stream/axi_stream_bfm.svh"
`include "../../common_interface_sim/axi_stream/axi_stream_drive.svh"

reg                     clk = 0;
always
    #(1s/100_000_000/2) clk = ~clk;

reg                     rst = 0;
initial
begin
    #1us; rst = 0;
    #10us; rst = 1;
end

axi_stream_bfm #
(
    .WIDTH  (8)
)
axi_stream_if 
(
    .s_aclk       (    clk      ),
    .s_aresetn    (    rst      )
);

//axi_stream_drive #(.width (8) ) axi_stream_drive_h;
axi_stream_drive #(8) axi_stream_drive_h;

initial begin
    force axi_stream_if.s_axis_tready = 1;
    #1us
    axi_stream_drive_h = new(axi_stream_if);
    @(posedge axi_stream_if.s_aresetn);
    @(posedge axi_stream_if.s_aclk);
    axi_stream_drive_h.write_random_frame(10, "WITH_TREADY");
    //axi_stream_drive_h.write_single_unit(32'h11, 4);
    //axi_stream_drive_h.write_single_unit(32'h22, 4);
    //axi_stream_drive_h.write_single_unit(32'h33, 4);
    //axi_stream_drive_h.write_single_unit(32'h44, 4);
end

stream_convert stream_convertEx01
(
    .aclk            (  axi_stream_if.s_aclk                ),
    .aresetn         (  axi_stream_if.s_aresetn             ),
    .s_axis_tvalid   (  axi_stream_if.m_axis_tvalid       ),
    .s_axis_tready   (  axi_stream_if.m_axis_tready       ),
    .s_axis_tdata    (  axi_stream_if.m_axis_tdata        ),
    .s_axis_tlast    (  axi_stream_if.m_axis_tlast        ),

    .m_axis_tvalid   (                      ),
    .m_axis_tready   (  axi_stream_if.s_axis_tready                    ),
    .m_axis_tdata    (                      )
    //.m_axis_tkeep    (                      ),
    //.m_axis_tlast    (                      )
);
endmodule
